#pragma once

#include <vector>

#include "Transformations.h"
#include "DCoordinates.h"

namespace cagd
{

	class CCamera
	{
	public:
		enum ECameraType{LANDOBJECT, AIRCRAFT};

		CCamera(
			ECameraType cameraType = AIRCRAFT, 
                        const DCoordinate &right = DCoordinate(1.0, 0.0, 0.0),
                        const DCoordinate &up = DCoordinate(0.0, 1.0, 0.0),
                        const DCoordinate &look = DCoordinate(0.0, 0.0, 1.0),
                        const DCoordinate &position = DCoordinate(0.0, 0.0, 1.0));

		void Strafe(float untis);					// left/right
		void Heighten(float units);					// up/down
		void Walk(float units);						// forward/backward

		void Pitch(float angle);					// rotate around right vector
		void Yaw(float angle);						// rotate around up vector
		void Roll(float angle);						// rotate around look vector

		void GetModelViewMatrix(std::vector<float> &matrix);
		void GetModelViewMatrix(CTransformation &transformation);

		void SetCameraType(ECameraType cameraType);

                DCoordinate GetPosition() const;
                void SetPosition(const DCoordinate &position);

                DCoordinate GetRight() const;
                void SetRight(const DCoordinate &right);

                DCoordinate GetUp() const;
                void SetUp(const DCoordinate &up);

                DCoordinate GetLook() const;
                void SetLook(const DCoordinate &look);

	private:
		ECameraType  _cameraType;
                DCoordinate _right;
                DCoordinate _up;
                DCoordinate _look;
                DCoordinate _position;
	};

}
